UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojcuoME0ILHhPKQjq5jIFlqzDL8o29wWynrHtMobC5g='
WHERE
key_id = 'fa7deac3f4811da6bf0dab94ccb0f4ce70ed5639f03677b1f37b3860b9b88bca'
AND (
token = 'ojcuoME0ILHhPKQjq5jIFlqzDL8o29wWynrHtMobC5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)