UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4+obvi0HOxRKW2oSJId0uj3ywqdeDlSH92asWXvT7Fc='
WHERE
key_id = '38645415a1f7b47a8550ed65ce09cfcc650d415df3fb8a05d997974a098c9cc8'
AND (
token = '4+obvi0HOxRKW2oSJId0uj3ywqdeDlSH92asWXvT7Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)