UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gzO5/IiDyMZfvT65JcETxAk/MYhqim1OAVPwL6+3Jf8='
WHERE
key_id = '3a508634ab9595f7a84770a9ae98722cf8ef390669bc3ecdc5cc016d6454face'
AND (
token = 'gzO5/IiDyMZfvT65JcETxAk/MYhqim1OAVPwL6+3Jf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)