UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIoGb1339SRB2hjYXPXO4qniounW+NhTcj5ueQziKTI='
WHERE
key_id = '57734c6fc9c5b5c3d8806f23e09ddefa4e39782c462b391f60d0ff8b0427deef'
AND (
token = 'hIoGb1339SRB2hjYXPXO4qniounW+NhTcj5ueQziKTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)