UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H7Ztn4eR+ojTUglD6wA6D85CILRTeC6/PEFlT/GDTgU=' 
WHERE 
  key_id = '2fd97bcf6af09594c543f1c02c1e2d3f4173012694da86672a29ffd2480ee1c7' 
  AND (
    token = 'H7Ztn4eR+ojTUglD6wA6D85CILRTeC6/PEFlT/GDTgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039