UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fu85SeqFL3BgKS8v0Z9cPnBJr5FH3no8OgwY0FhQDu0=' 
WHERE 
  key_id = '71f1a9e7e11c2c3b6a1713b9f11e47df24107e49154ba68eeb4c70b30b2161bb' 
  AND (
    token = 'Fu85SeqFL3BgKS8v0Z9cPnBJr5FH3no8OgwY0FhQDu0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020