UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pF065Fsyl4BEXmPVMu+mlYO55yQqcNkHQ8UYvxT0xjQ='
WHERE
key_id = 'b600b5149bc5be2260e0e52d8ecd357e6207897fe7438c24e634f2b92c4e4417'
AND (
token = 'pF065Fsyl4BEXmPVMu+mlYO55yQqcNkHQ8UYvxT0xjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)