UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OuZWSpPksmIBpCfBj5ZSzDOF1wKyvMl+EFd2iTo6wnM='
WHERE
key_id = 'a67c53f2bf961ff0ba924f4b57a801c526c09d988045b5ad3f6849f9d11273d0'
AND (
token = 'OuZWSpPksmIBpCfBj5ZSzDOF1wKyvMl+EFd2iTo6wnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)