UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HN55w/NoslhdknQNdP/ZWrOtt/Io+DpLgRx9v+P6TXg=' 
WHERE 
  key_id = 'fed55e06bb73e532e84da4dff9c9140dc5d90509acf0f84e0fe56e0df0e46ad5' 
  AND (
    token = 'HN55w/NoslhdknQNdP/ZWrOtt/Io+DpLgRx9v+P6TXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030