UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Cxg95c9Mi8cTwRYtSKUkUk5jczmXnE6LSixbDmGAjA=' 
WHERE 
  key_id = '2f10362a45ddcb09854f1302c793b9d63500d1d425ad6a67c132405243846887' 
  AND (
    token = '4Cxg95c9Mi8cTwRYtSKUkUk5jczmXnE6LSixbDmGAjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019