UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QRUQ+vzTr2vATk+Z4is/YViLAAU0/FoPiBcMmhp45vA='
WHERE
key_id = 'cdd99f2456c978460e0c49f890f0325d09b4bf83c92956f8c5f31ddabb8a7559'
AND (
token = 'QRUQ+vzTr2vATk+Z4is/YViLAAU0/FoPiBcMmhp45vA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)