UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gIeXYe26pukh/YUalBcsh94q5bE1LDddkjVFyUlrNwY=' 
WHERE 
  key_id = '9f1dd800bedb6813f7b5ecbe474d306d09541dc0fcd3aea2071500afd3501dcb' 
  AND (
    token = 'gIeXYe26pukh/YUalBcsh94q5bE1LDddkjVFyUlrNwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017