UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aG61IN6nkM2dWEa1q2EJ2dlJWcMftl1yGDcYAbEauLw=' 
WHERE 
  key_id = '91db8d4e7f23a5b582422c43ec695f00c3973803ffc322eb0cc2fd6bf303aeb1' 
  AND (
    token = 'aG61IN6nkM2dWEa1q2EJ2dlJWcMftl1yGDcYAbEauLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034