UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TL1E+yo8Klq6m2MmyQj8+YkQ00eAbe/ZJ4jEaFephH0=' 
WHERE 
  key_id = '31e2bc5b7ac3f79dc5e1ce55c9335cd65b88fd0e577ef416fcae8739723fb8b2' 
  AND (
    token = 'TL1E+yo8Klq6m2MmyQj8+YkQ00eAbe/ZJ4jEaFephH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038