UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3QCGVleke+MT6XwEo+zwvQkBO3NGZW57UDBMS/pRFU='
WHERE
key_id = 'e705e66966d3a781a8a4c65c0be3315e3bd282445b2d3a434dfb551da77aa810'
AND (
token = 'u3QCGVleke+MT6XwEo+zwvQkBO3NGZW57UDBMS/pRFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)