UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81nbAk5q8RbY9TQzM5xQPiYPZ7BT3T+ysSLBEVuxgo0=' 
WHERE 
  key_id = 'e26111a053b3be73c6c7a13ddb3a8700d722640cdc8eafb5807d7e18698adda7' 
  AND (
    token = '81nbAk5q8RbY9TQzM5xQPiYPZ7BT3T+ysSLBEVuxgo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028