UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2YfvGboHDDoBABScV7hjd+d1wCWGJEo4+fjC+2cqedE=' 
WHERE 
  key_id = 'a0c84a45cb5ae298f77b22f9d0dc655a97f4de58216e0d7964756911d3ba9741' 
  AND (
    token = '2YfvGboHDDoBABScV7hjd+d1wCWGJEo4+fjC+2cqedE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036