UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2N+RJm49sIK6FLeq2/c/j0wlkWp/8q6ZbfdCBusJ/4='
WHERE
key_id = 'e7a1de0dde07df921bbb0a364100d398aad6969dfc44c83497dbdb2d5c960ea3'
AND (
token = 'G2N+RJm49sIK6FLeq2/c/j0wlkWp/8q6ZbfdCBusJ/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)