UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DXlbewu07NcyBkVyd4QZ2JkUWUzBBB6wRpDhf36yvXA='
WHERE
key_id = '732e86d6f1ab0846da8c25db752d7762d43fdbafcece816e2779f6c57497b03f'
AND (
token = 'DXlbewu07NcyBkVyd4QZ2JkUWUzBBB6wRpDhf36yvXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)