UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BxNT9I6rnJuieFoNhex3fjWN8i4TSsOCy8wQW9DnFH0=' 
WHERE 
  key_id = '19d1a009dd5feab52244f234ccdac1097470173db4073f10bc510e516fcb85d2' 
  AND (
    token = 'BxNT9I6rnJuieFoNhex3fjWN8i4TSsOCy8wQW9DnFH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021