UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'raHzMK1iBhmwTc2ef1tGsJ/ddclRrgYqlecqvFgJPAY='
WHERE
key_id = '44ba8ae8f511f38257a61fd99fbc36ae768752905f68a086c6015e0138b80ae6'
AND (
token = 'raHzMK1iBhmwTc2ef1tGsJ/ddclRrgYqlecqvFgJPAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)