UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8B3cQ1bNrNwnxM86cAmCFTM3pJExsWWdrFghyduxR5A=' 
WHERE 
  key_id = '640d2880fe4343812c9f1ad0a7b53881b4241d6efaa217e0bac916e072e9f723' 
  AND (
    token = '8B3cQ1bNrNwnxM86cAmCFTM3pJExsWWdrFghyduxR5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017