UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4AOYqj1ufSS/vxh/7JitZ7T8pIltrjVzpHjNBq8LB4='
WHERE
key_id = 'ce18faf4485136b94521b8e802a397652da333810fbcc9a04e887e89fe127571'
AND (
token = 'q4AOYqj1ufSS/vxh/7JitZ7T8pIltrjVzpHjNBq8LB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)