UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j7ZTZSQK09Jvnqok/uD3ZdWjuMlpHOzFfYUpgelaXPI=' 
WHERE 
  key_id = 'ca87766d01a34371ed85fed81a206b3db997d2c32c7a5bbe82b543ceac258e2e' 
  AND (
    token = 'j7ZTZSQK09Jvnqok/uD3ZdWjuMlpHOzFfYUpgelaXPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037