UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fUFMpQCSxOb0nKTKv8A+LWYDvr/0CqppUbrokcs/Rpg=' 
WHERE 
  key_id = 'a1ae12f34d9e0c1f16a6cab489b04b1556dd9938e67a02e7bf381ae433929035' 
  AND (
    token = 'fUFMpQCSxOb0nKTKv8A+LWYDvr/0CqppUbrokcs/Rpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019