UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W1QtUqfzWQF7DaQn3gldoFNYqJUVWipuxS+LRFnY7nQ='
WHERE
key_id = 'bec27d19e614bec6718570795c58941a36d08920b7bc59dcdd087f25edf9ecc5'
AND (
token = 'W1QtUqfzWQF7DaQn3gldoFNYqJUVWipuxS+LRFnY7nQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)