UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A+v34pwzD+RRm/ovni0Ldk70f0SSlJbTYg+XL9SR37A='
WHERE
key_id = '3cf1c699f96c36d785e9d0993f8ce33607f90c54afc7d29c215dc9b5f97c9e31'
AND (
token = 'A+v34pwzD+RRm/ovni0Ldk70f0SSlJbTYg+XL9SR37A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)