UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rQ8opcfBUvKoK1D2d5jNl1Exuncbnc6i81k5tdPT/pY='
WHERE
key_id = '2e6cfb8e906c8d5ae50fd334943b10033fa2d120582c91849b8154bddb6d81d1'
AND (
token = 'rQ8opcfBUvKoK1D2d5jNl1Exuncbnc6i81k5tdPT/pY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)