UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Mds7u8Ry4SciJOEVIVJgWgESCQ7y5Z3ObYvfMi3Zpc='
WHERE
key_id = '11ad24bce6c0e8b701f7a78f43d63f19652746bfdd1f9cc4251e520a3d079d8b'
AND (
token = '3Mds7u8Ry4SciJOEVIVJgWgESCQ7y5Z3ObYvfMi3Zpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)