UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '27qHvIKCY1TGGY8dvzPUGri5fCbG8PXaZdeZuXTwhPQ=' 
WHERE 
  key_id = 'c85c7e4dc122db47a2ec396870225090a5812a67802379ae7195db24d859cdfc' 
  AND (
    token = '27qHvIKCY1TGGY8dvzPUGri5fCbG8PXaZdeZuXTwhPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036