UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZgNYwofbij1Ugwy3df8UboVelylpTxwiXolyimDXjY='
WHERE
key_id = '6ebadc6a0ef1026c9b5e1d7a54bbfae09526548d2f405bf05dc5cfd046f6845c'
AND (
token = '8ZgNYwofbij1Ugwy3df8UboVelylpTxwiXolyimDXjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)