UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l3Gr/v59XFbj/DIXYH3ALudqGkUQTrmtrOH9NvYCJ84=' 
WHERE 
  key_id = '380281d60d663cf2f740a80880d935b6753a2cf13051a4f91709d830a9157c09' 
  AND (
    token = 'l3Gr/v59XFbj/DIXYH3ALudqGkUQTrmtrOH9NvYCJ84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020