UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R9+Ll0ZfS5hah+jf/td7xAJz8DIwq/WeExxZqEDgVTc=' 
WHERE 
  key_id = '5b6f698b86fd5517bb7d41279b91d0dcebf18a8514c968a371f9440b6bfb9d46' 
  AND (
    token = 'R9+Ll0ZfS5hah+jf/td7xAJz8DIwq/WeExxZqEDgVTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073